package br.usp.ime.lab.math;


import org.junit.Before;
import org.junit.Test;
import org.junit.Assert;
import br.usp.ime.lab.math.ProximoPar;

public class ProximoParTest  {

	/**
	 * Classe usada para validar a classe ProximoPar.
	 */
	
	private ProximoPar proximoPar;

	@Before
	public void setUp() {
		proximoPar = new ProximoPar();
	}

	@Test
	public void proximoPar() {
		Assert.assertEquals(new Integer(0), proximoPar.proximoPar(null));
	}

	@Test
	public void testNumPar() throws Exception {
		Integer num = 2 * ((int) Math.random());
		Integer esperado = num + 2;
		Assert.assertEquals(esperado, proximoPar.proximoPar(num));
	}

	@Test
	public void testNumImpar() throws Exception {
		Integer num = 2 * ((int) Math.random()) + 1;
		Integer esperado = num + 1;
		Assert.assertEquals(esperado, proximoPar.proximoPar(num));
	}
}